import { lazy } from 'react'
import { RouterList } from '../utils/index'
export const mainRouter: RouterList = [
  {
    path: '/articles',
    element: lazy(async () => await import('../page/home/Articles')),
    children: [
      {
        path: '/articles/categroy/:id',
        element: lazy(async () => await import('../page/home/tab/Categroy'))
      },
      {
        path: '/articles/tag/:id',
        element: lazy(async () => await import('../page/home/tab/Classify'))
      }
    ],
    title: 'articles',
    flag: true
  },
  {
    path: '/archives',
    element: lazy(async () => await import('../page/home/Archives')),
    title: 'archives',
    flag: true
  },
  {
    path: '/knowledge_Books',
    element: lazy(async () => await import('../page/home/Knowledge_Books')),
    title: 'knowledge_Books',
    flag: true
  },
  {
    path: '/detail',
    element: lazy(async () => await import('../page/Detail')),
    flag: false
  }
]
const routes: RouterList = [
  {
    path: '/',
    to: '/articles'
  },
  {
    path: '/',
    element: lazy(async () => await import('../page/Index')),
    children: mainRouter
  },
  {
    path: '/search',
    element: lazy(async () => await import('../page/Search'))
  }

]

export default routes
